/**
业主详情页面
 **/
(function (vc) {
    vc.extends({
        data: {
            aOrderDetailInfo: {
                orderId: '',
                appId: '',
                appName: '',
                deduction: '',
                personName: '',
                stateName: '',
                profitSharing: '',
                payPrice: '',
                createTime: '',
                remark:'',
                _currentTab: 'aOrderDetailCarts',
            }
        },
        _initMethod: function () {
            $that.aOrderDetailInfo.orderId = vc.getParam('orderId');
            if (!vc.notNull($that.aOrderDetailInfo.orderId)) {
                return;
            }
            $that._listAOrderDetail();

        },
        _initEvent: function () {
            vc.on('aOrderDetail', 'listCarData', function (_info) {
                //$that._loadFeeDetailInfo();
                $that.changeTab($that.aOrderDetailInfo._currentTab);
            });
        },
        methods: {
            _listAOrderDetail: function (_page, _rows) {

                let param = {
                    params: {
                        page:1,
                        row:1,
                        orderId:$that.aOrderDetailInfo.orderId
                    }
                };

                //发送get请求
                vc.http.apiGet('/storeOrder.queryAdminStoreOrder',
                    param,
                    function (json, res) {
                        let _json = JSON.parse(json);
                        vc.copyObject(_json.data[0],$that.aOrderDetailInfo);
                        $that.changeTab($that.aOrderDetailInfo._currentTab);

                    }, function (errInfo, error) {
                        console.log('请求失败处理');
                    }
                );
            },
            changeTab: function (_tab) {
                $that.aOrderDetailInfo._currentTab = _tab;
               
                vc.emit(_tab, 'switch', {
                    orderId: $that.aOrderDetailInfo.orderId,
                });
            },
           
        }
    });
})(window.vc);